<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        let str = '黑桃;方片;草花;红心';
        let arr = str.split(';');
        console.log(arr);

        // 数组连接
        let newStr = arr.join('');
        console.log(newStr);

        // 追加
        let arr1 = [1,2,3];
        arr1.push(4,5,6);
        console.log(arr1);

        // 增删改splice
        let arr2 = [1,2,3,5,6];
        // 插入
        // arr2.splice(3,0,4);
        // console.log(arr2);

        // 删除
        // arr2.splice(3,1);
        // console.log(arr2);

        // 改
        // arr2.splice(3,1,4);
        // console.log(arr2);
    </script>
</body>
</html>